package bg.btanev.eightyfour.shared.command.stat;

import java.io.Serializable;

import bg.btanev.eightyfour.shared.dto.TagDto;
import bg.btanev.eightyfour.shared.dto.profile.ProfileDto;
import bg.btanev.eightyfour.shared.dto.profile.ProfileEventDto;

import com.google.gwt.user.client.rpc.IsSerializable;

/**
 *
 * @author B.Tanev
 *
 */
public class StatSummaryCommandResult implements IsSerializable, Serializable {
	/**
	 *
	 */
	private static final long serialVersionUID = 4861312939502427658L;

	private ProfileDto<ProfileEventDto> mostActiveProfile;
	private long profileEventsCount;
	private long totalProfileEventsCount;
	private TagDto mostCommonTag;
	private long mostCommonTagProfilesEventsCount;
	private long totalTaggedProfileEvents;
	private long totalTagsUsed;
	private long totalUniqueTagsUsed;
	private long totalProfilesCount;

	public StatSummaryCommandResult() {
		super();
	}

	public ProfileDto<ProfileEventDto> getMostActiveProfile() {
		return mostActiveProfile;
	}

	public void setMostActiveProfile(ProfileDto<ProfileEventDto> mostActiveProfile) {
		this.mostActiveProfile = mostActiveProfile;
	}

	public long getProfileEventsCount() {
		return profileEventsCount;
	}

	public void setProfileEventsCount(long profileEventsCount) {
		this.profileEventsCount = profileEventsCount;
	}

	public long getTotalProfileEventsCount() {
		return totalProfileEventsCount;
	}

	public void setTotalProfileEventsCount(long totalProfileEventsCount) {
		this.totalProfileEventsCount = totalProfileEventsCount;
	}

	public TagDto getMostCommonTag() {
		return mostCommonTag;
	}

	public void setMostCommonTag(TagDto mostCommonTag) {
		this.mostCommonTag = mostCommonTag;
	}

	public long getMostCommonTagProfilesEventsCount() {
		return mostCommonTagProfilesEventsCount;
	}

	public void setMostCommonTagProfilesEventsCount(long mostCommonTagProfilesEventsCount) {
		this.mostCommonTagProfilesEventsCount = mostCommonTagProfilesEventsCount;
	}

	public long getTotalTaggedProfileEvents() {
		return totalTaggedProfileEvents;
	}

	public void setTotalTaggedProfileEvents(long totalTaggedProfileEvents) {
		this.totalTaggedProfileEvents = totalTaggedProfileEvents;
	}

	public long getTotalTagsUsed() {
		return totalTagsUsed;
	}

	public void setTotalTagsUsed(long totalTagsUsed) {
		this.totalTagsUsed = totalTagsUsed;
	}

	public long getTotalProfilesCount() {
		return totalProfilesCount;
	}

	public void setTotalProfilesCount(long totalProfilesCount) {
		this.totalProfilesCount = totalProfilesCount;
	}

	public long getTotalUniqueTagsUsed() {
		return totalUniqueTagsUsed;
	}

	public void setTotalUniqueTagsUsed(long totalUniqueTagsUsed) {
		this.totalUniqueTagsUsed = totalUniqueTagsUsed;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((mostActiveProfile == null) ? 0 : mostActiveProfile.hashCode());
		result = prime * result + (int) (mostCommonTagProfilesEventsCount ^ (mostCommonTagProfilesEventsCount >>> 32));
		result = prime * result + (int) (profileEventsCount ^ (profileEventsCount >>> 32));
		result = prime * result + (int) (totalProfileEventsCount ^ (totalProfileEventsCount >>> 32));
		result = prime * result + (int) (totalProfilesCount ^ (totalProfilesCount >>> 32));
		result = prime * result + (int) (totalTaggedProfileEvents ^ (totalTaggedProfileEvents >>> 32));
		result = prime * result + (int) (totalTagsUsed ^ (totalTagsUsed >>> 32));
		result = prime * result + (int) (totalUniqueTagsUsed ^ (totalUniqueTagsUsed >>> 32));
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		StatSummaryCommandResult other = (StatSummaryCommandResult) obj;
		if (mostActiveProfile == null) {
			if (other.mostActiveProfile != null)
				return false;
		} else if (!mostActiveProfile.equals(other.mostActiveProfile))
			return false;
		if (mostCommonTagProfilesEventsCount != other.mostCommonTagProfilesEventsCount)
			return false;
		if (profileEventsCount != other.profileEventsCount)
			return false;
		if (totalProfileEventsCount != other.totalProfileEventsCount)
			return false;
		if (totalProfilesCount != other.totalProfilesCount)
			return false;
		if (totalTaggedProfileEvents != other.totalTaggedProfileEvents)
			return false;
		if (totalTagsUsed != other.totalTagsUsed)
			return false;
		if (totalUniqueTagsUsed != other.totalUniqueTagsUsed)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "StatSummaryCommandResult [mostActiveProfile=" + mostActiveProfile + ", mostCommonTag=" + mostCommonTag
				+ ", mostCommonTagProfilesEventsCount=" + mostCommonTagProfilesEventsCount + ", profileEventsCount="
				+ profileEventsCount + ", totalProfileEventsCount=" + totalProfileEventsCount + ", totalProfilesCount="
				+ totalProfilesCount + ", totalTaggedProfileEvents=" + totalTaggedProfileEvents + ", totalTagsUsed="
				+ totalTagsUsed + ", totalUniqueTagsUsed=" + totalUniqueTagsUsed + "]";
	}

}